Skip to content

fix(omp): discover title-first session transcripts - #846

Merged
iamtoruk merged 2 commits into
getagentseal:mainfrom
jbspeakr:fix/omp-session-discovery
Aug 3, 2026
Merged

fix(omp): discover title-first session transcripts#846
iamtoruk merged 2 commits into
getagentseal:mainfrom
jbspeakr:fix/omp-session-discovery

Conversation

@jbspeakr

@jbspeakr jbspeakr commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #845 by changing shared Pi/OMP JSONL discovery to find the first type: "session" record rather than requiring it on the first physical line.

OMP may store mutable session titles as a fixed-width type: "title" record before the JSONL session header. CodeBurn previously rejected these otherwise valid transcripts before parsing.

Changes

  • Replaced first-line-only session detection with a JSONL scan for the first session record.
  • Skips blank lines, malformed JSON, and non-session metadata—including OMP title slots.
  • Preserves the existing readSessionFile() read-size and error behavior.
  • Adds a regression fixture with a title record and blank line before the session header.
  • Renames Pi/OMP negative-test wording: files are rejected only when they contain no session record.

Testing

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds

For new providers only:

  • I installed the tool and generated real sessions by using it
  • npm run dev -- today shows correct costs and session counts for this provider
  • npm run dev -- models --provider <name> shows correct model names and pricing
  • Screenshot or terminal output attached below proving it works with real data

Co-authored-by: openai/gpt-5.6-terra <noreply@openai.com>

@iamtoruk iamtoruk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #845. Clean, well-scoped fix: readSessionEntry now scans the JSONL for the first type: "session" record (skipping blank lines, malformed JSON, and non-session metadata like OMP's type: "title" slot) instead of requiring it on the first physical line. Since readSessionFile reads the whole file up to its size cap, the scan reaches the header regardless of how many title/blank lines precede it, and oversize files were already skipped before this change, so there is no read-size regression.

No regression for Pi or ordinary OMP transcripts (session on line 1 is found immediately); files with no session record are still rejected. Mutation-checked: the new "discovers title-first sessions" test fails on main and passes with the fix; the other discovery cases pass both ways. On the merged tree (main was 37 ahead, clean): tsc clean, omp/pi provider suites 31/31, full suite green apart from the two pre-existing parser.test.ts failures (and a cache-refresh-lock heartbeat test that flakes under parallel load and passes in isolation, untouched by this change). Good to merge.

@iamtoruk
iamtoruk merged commit b8c92bf into getagentseal:main Aug 3, 2026
iamtoruk added a commit to avs-io/codeburn that referenced this pull request Aug 3, 2026
iamtoruk added a commit that referenced this pull request Aug 3, 2026
…he all-provider view

buildDurablePeriod derived the today slice of the multi-day, all-provider
headline from the unsliced whole-range parse, so a turn spanning local midnight
kept its category and turn count anchored on its yesterday start. The per-call
cost and calls bucketed onto today correctly, but By Activity and the JSON
daily turn count lost the post-midnight half — categories summed to only the
pre-midnight cost while the headline, By Model and By Project were right.

Slice the today parse with filterProjectsByDays first, which re-anchors the
straddling turn to its surviving today calls, so today's category cost lands on
today. Category cost is the sum of the slice's own calls, so day-N + day-N+1
still equals the whole-range total (no over-count); the per-day turn-count
split matches the cache side and the documented per-day semantics.

Adds a regression test in the straddling-turn conservation suite
(mutation-checked: fails on the pre-fix code). Also fills in the CHANGELOG
Unreleased entries for the batch (#853, #856, #872, #846/#859, #866/#867, #833).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OMP title-slot metadata prevents session discovery

2 participants